package com.example.demo.controller;

import com.example.demo.entity.Log;
import com.example.demo.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;

    @GetMapping("/{userId}")
    public List<Log> getLogsByUserId(@PathVariable int userId) {
        return logService.getLogsByUserId(userId);
    }
}